﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.DirectX;

namespace RayTracerLib.Geometry
{
    /// <summary>
    /// Трассировочный луч
    /// </summary>
    public class Ray
    {
        public Point3D Start { get; set; }
        public Vector3 Dir { get; set; }
        public Ray()
        {
            Start = new Point3D();
            Dir = new Vector3();
        }
        public Ray(Point3D start, Vector3 dir)
        {
            Start = start;
            Dir = dir;
        }
        public Ray PositionAtTime(float time)
        {
            Ray result = new Ray();
            result.Dir = Dir;
            result.Start.X = Start.X + Dir.X * time;
            result.Start.Y = Start.Y + Dir.Y * time;
            result.Start.Z = Start.Z + Dir.Z * time;
            return result;
        }
    }
}
